$(function () {
    init_chongfu_data();
});
function init_chongfu_data() {
    var settings = {
        url: ctx + "myCustomer/checkCustomer",
        pageSize: 13,
        queryParams: function(params) {
            return {
                pageSize: params.limit,
                pageNum: params.offset / params.limit + 1,
                mobile:$("#checkMobile").val().trim()
            };
        },
        columns: [{
            field: 'mobile',
            class:'text-center',
            title: '手机'
        }, {
            field: 'mobileCount',
            class:'text-center',
            title: '客户重复数量',
            formatter:function (value, row, index) {
                return "<a href='javascript:void(0);' count='"+row.mobileCount+"' data='"+row.mobile+"' onclick='loadCkeckDetail(this)'>"+value+"</a>";
            }
        }, {
            field: 'mobile',
            class:'text-center',
            title: '操作',
            formatter:function (value, row, index) {
                return "<a href='javascript:void(0);' count='"+row.mobileCount+"' data='"+row.mobile+"' onclick='loadCkeckDetail(this)'>合并客户</a>";
            }
        }],
    };
    $JuXue.initTable('ckeckTab', settings);
}

/**重复客户列表*/
function loadCkeckDetail(btn){
    var mobile = $(btn).attr("data");
    $("#checkDetailMobile").val(mobile);
    var count = $(btn).attr("count");
    $("#checkDetailCount").val(count);
    $.post(ctx+"myCustomer/loadCkeckDetail",{},function (r) {
        $("#myCustomer-checkDetail").empty().append(r).modal('show').draggable();
    });
}

function selectCkeck() {
    $JuXue.refreshTable('ckeckTab');
}